/*
	File:		EntityController.h
	Author:		dmonroe
	Date:		1/12/2012
	Copyright:	Full Sail University

	Purpose:	Base class for game object controllers
*/

#include "../source/EntityController.h"
#include "../source/Entity.h"

#include <cassert>


//******************************************************************
// CONSTRUCTOR
CEntityController::CEntityController( void )
{
	m_ulReferenceCount = 1;
}
//******************************************************************



//******************************************************************
// DESTRUCTOR
/*virtual*/ CEntityController::~CEntityController( void )
{
}
//******************************************************************



//******************************************************************
// UPDATE
/*virtual*/ bool	CEntityController::Update				( const CEntity* pEntity, float fElapsedTime )
{
	(void)pEntity;		// ignored
	(void)fElapsedTime;	// ignored
	return true;
}
//******************************************************************



//******************************************************************
// SHOULD PERFORM
/*virtual*/ bool	CEntityController::ShouldPerform		( const CEntity* pEntity )
{
	(void)pEntity;		// ignored
	return false;
}
//******************************************************************



//******************************************************************
// SHOULD PERFORM ACTION
/*virtual*/ float	CEntityController::ShouldPerformAction	( const CEntity* pEntity, unsigned long ulActionID )
{
	(void)pEntity;		// ignored
	(void)ulActionID;	// ignored
	return 0.0f;
}
//******************************************************************



//******************************************************************
// ADD REF
void	CEntityController::AddRef	( void )
{
	assert( m_ulReferenceCount != 0xFFFFFFFF && "CEntityController::AddRef - reference count exceeds maximum" != 0 );
	++m_ulReferenceCount;
}
//******************************************************************	



//******************************************************************	
// RELEASE
void	CEntityController::Release	( void )
{
	--m_ulReferenceCount;

	if( m_ulReferenceCount == 0 )
		delete this;
}
//******************************************************************


